#include <pybind11/pybind11.h>
#include <pybind11/stl.h>
#include <SceneGraph/animable.h>
#include <string>
using namespace PhysLeo;
namespace py = pybind11;

class PyAnimable : public Animable
{
public:
    //extends all Animable's constructors
    using Animable::Animable;

    void initSimulationResource() override
    {
        PYBIND11_OVERLOAD_PURE(void, Animable, initSimulationResource, );
    }

    void run(float dt) override
    {
        PYBIND11_OVERLOAD_PURE(void, Animable, run, dt);
    }

    void transformDrawData() override
    {
        PYBIND11_OVERLOAD_PURE(void, Animable, transformDrawData, );
    }

    void updateDrawData() override
    {
        PYBIND11_OVERLOAD_PURE(void, Animable, updateDrawData, );
    }
};

void initAnimable(py::module &mod)
{
    using class_type = Animable;
    using helper_type = PyAnimable;
    auto pyclass_name = std::string("Animable");
    py::class_<class_type, helper_type, std::shared_ptr<class_type>>cls(mod, pyclass_name.c_str());

    cls.def(py::init<>());
    cls.def("setMaxDt", &class_type::setMaxDt);
    cls.def("initSimulationResource", &class_type::initSimulationResource);
    cls.def("run", &class_type::run);
    cls.def("transformDrawData", &class_type::transformDrawData);
    cls.def("updateDrawData", &class_type::updateDrawData);
}
